package com.zhz.web;

import com.zhz.servlet.ZhzServlet;
import org.apache.catalina.startup.Tomcat;

/**
 * @author zhouhengzhe
 * @description:
 * @date 2021/11/30 下午7:53
 * @since v1
 */
public class ZhzSpringBootApplication {
	public static void run() throws Exception {

		// 创建Tomcat应用对象
		Tomcat tomcat = new Tomcat();
		// 设置Tomcat的端口号
		tomcat.setPort(8080);

		tomcat.addWebapp("/zhz","D:\\server");

		// 创建Servlet
		tomcat.addServlet("/zhz", "zhzServlet", new ZhzServlet());
		// Servlet映射
		//standardContext.addServletMappingDecoded("/hello", "tulingServlet");
		//启动tomcat容器
		tomcat.start();
		//等待
		tomcat.getServer().await();
	}

}
